#include<iostream>

using namespace std;

class Date
{
public:
	Date(int year = 0, int month = 0, int day = 0)
	{
		_year = year;
		_month = month;
		_day = day;
	}

	Date(const Date& d)
	{
		_year = d._year;
		_month = d._month;
		_day = d._day;
	}
	void Print()
	{
		cout << _year << "-" << _month << "-" << _day << endl;
	}

	~Date()
	{}
private:
	int _year;
	int _month;
	int _day;
};

class Stack
{
public:
	Stack(int capacity = 4)
	{
		_a = (int*)malloc(sizeof(int) * capacity);
		if (_a == nullptr)
		{
			perror("malloc");
			return;
		}
		_capacity = capacity;
	}
	//void Push(int n)
	//{
	//	if (_top < _capacity)
	//	{
	//		_a[_top] = n;
	//		_top++;
	//	}
	//	else
	//	{

	//	}
	//}

	Stack(const Stack& st)
	{
		_a = (int*)malloc(sizeof(int) * st._capacity);
		if (_a == nullptr)
		{
			perror("malloc");
			return;
		}
		memcpy(_a, st._a, sizeof(int) * st._top);
		_top = st._top;
		_capacity = st._capacity;
	}
	~Stack()
	{
		free(_a);
		_a = nullptr;
		_top = 0;
		_capacity = 0;
	}

private:
	int* _a = nullptr;
	int _top = 0;
	int _capacity;
};


int main()
{
	Date d1(2025, 9, 6);
	Date d2(2025, 9, 1);
	Date d3(d1);
	d3.Print();

	Stack s1(5);
	Stack s2(s1);

	return 0;
}